package com.surenpi.jenkins.client.workflow;

import com.surenpi.jenkins.client.BaseModel;
import com.surenpi.jenkins.client.JenkinsClient;
import java.sql.Timestamp;
import java.util.List;

public class WfWithDetails extends BaseModel {
   String id;
   String name;
   String status;
   Timestamp startTimeMillis;
   Timestamp endTimeMillis;
   long durationMillis;
   long queueDurationMillis;
   long pauseDurationMillis;
   boolean building;
   List<Stage> stages;
   private JenkinsClient client;

   public String getId() {
      return this.id;
   }

   public void setId(String id) {
      this.id = id;
   }

   public String getName() {
      return this.name;
   }

   public void setName(String name) {
      this.name = name;
   }

   public String getStatus() {
      return this.status;
   }

   public void setStatus(String status) {
      this.status = status;
   }

   public Timestamp getStartTimeMillis() {
      return this.startTimeMillis;
   }

   public void setStartTimeMillis(Timestamp startTimeMillis) {
      this.startTimeMillis = startTimeMillis;
   }

   public Timestamp getEndTimeMillis() {
      return this.endTimeMillis;
   }

   public void setEndTimeMillis(Timestamp endTimeMillis) {
      this.endTimeMillis = endTimeMillis;
   }

   public long getDurationMillis() {
      return this.durationMillis;
   }

   public void setDurationMillis(long durationMillis) {
      this.durationMillis = durationMillis;
   }

   public long getQueueDurationMillis() {
      return this.queueDurationMillis;
   }

   public void setQueueDurationMillis(long queueDurationMillis) {
      this.queueDurationMillis = queueDurationMillis;
   }

   public long getPauseDurationMillis() {
      return this.pauseDurationMillis;
   }

   public void setPauseDurationMillis(long pauseDurationMillis) {
      this.pauseDurationMillis = pauseDurationMillis;
   }

   public List<Stage> getStages() {
      return this.stages;
   }

   public void setStages(List<Stage> stages) {
      this.stages = stages;
   }

   public boolean isBuilding() {
      return this.building;
   }

   public void setBuilding(boolean building) {
      this.building = building;
   }

   public int hashCode() {
      int prime = 31;
      int result = super.hashCode();
      result = 31 * result + (int)(this.durationMillis ^ this.durationMillis >>> 32);
      result = 31 * result + (this.endTimeMillis == null ? 0 : this.endTimeMillis.hashCode());
      result = 31 * result + (this.id == null ? 0 : this.id.hashCode());
      result = 31 * result + (this.name == null ? 0 : this.name.hashCode());
      result = 31 * result + (int)(this.pauseDurationMillis ^ this.pauseDurationMillis >>> 32);
      result = 31 * result + (int)(this.queueDurationMillis ^ this.queueDurationMillis >>> 32);
      result = 31 * result + (this.stages == null ? 0 : this.stages.hashCode());
      result = 31 * result + (this.startTimeMillis == null ? 0 : this.startTimeMillis.hashCode());
      result = 31 * result + (this.status == null ? 0 : this.status.hashCode());
      return result;
   }

   public boolean equals(Object obj) {
      if (this == obj) {
         return true;
      } else if (!super.equals(obj)) {
         return false;
      } else if (this.getClass() != obj.getClass()) {
         return false;
      } else {
         WfWithDetails other = (WfWithDetails)obj;
         if (this.durationMillis != other.durationMillis) {
            return false;
         } else {
            if (this.endTimeMillis == null) {
               if (other.endTimeMillis != null) {
                  return false;
               }
            } else if (!this.endTimeMillis.equals(other.endTimeMillis)) {
               return false;
            }

            if (this.id == null) {
               if (other.id != null) {
                  return false;
               }
            } else if (!this.id.equals(other.id)) {
               return false;
            }

            if (this.name == null) {
               if (other.name != null) {
                  return false;
               }
            } else if (!this.name.equals(other.name)) {
               return false;
            }

            if (this.pauseDurationMillis != other.pauseDurationMillis) {
               return false;
            } else if (this.queueDurationMillis != other.queueDurationMillis) {
               return false;
            } else {
               if (this.stages == null) {
                  if (other.stages != null) {
                     return false;
                  }
               } else if (!this.stages.equals(other.stages)) {
                  return false;
               }

               if (this.startTimeMillis == null) {
                  if (other.startTimeMillis != null) {
                     return false;
                  }
               } else if (!this.startTimeMillis.equals(other.startTimeMillis)) {
                  return false;
               }

               if (this.status == null) {
                  if (other.status != null) {
                     return false;
                  }
               } else if (!this.status.equals(other.status)) {
                  return false;
               }

               return true;
            }
         }
      }
   }

   public String toString() {
      return "WfWithDetails [id=" + this.id + ", name=" + this.name + ", status=" + this.status + ", startTimeMillis=" + this.startTimeMillis + ", endTimeMillis=" + this.endTimeMillis + ", durationMillis=" + this.durationMillis + ", queueDurationMillis=" + this.queueDurationMillis + ", pauseDurationMillis=" + this.pauseDurationMillis + ", stages=" + this.stages + "]";
   }

   public void setClient(JenkinsClient client) {
      this.client = client;
   }

   public JenkinsClient getClient() {
      return this.client;
   }
}
